/*
 * camera_drv.h
 *
 * Created: 20.03.2013 21:22:49
 *  Author: Timmo
 */ 


#ifndef CAMERA_DRV_H_
#define CAMERA_DRV_H_

#define CAMERA_PORT		PORTE
#define SHUTTER_PIN		PIN0
#define FOCUS_PIN		PIN1


#define TOGGLE_TIME     200     //Shutter press time in ms
#define SHUTTER_GAP     1500    //wait time between two shutter toggles
#define PREFOCUS_TIME   200     //Time in ms between focus and shutter
#define WAKEUP_AFTER    10      // If interval > 10 sec */
#define WAKEUP_TIME     2       //we toggle Focus and wait 2 secs

#define focus_press() CAMERA_PORT.OUTSET |= (1<<FOCUS_PIN)
#define focus_release() CAMERA_PORT.OUTCLR |= (1<<FOCUS_PIN)

#define init_cameraport() CAMERA_PORT.DIR |= (1<<FOCUS_PIN) | (1<<SHUTTER_PIN);

void shutter_toggle();
void shutter_press();
void shutter_release();
void camera_wakeup();



#endif /* CAMERA_DRV_H_ */